<?php
/**
 * Anything added to this helper will be available to all templates in the Intake controller.
 */

function clean_variables_for_mail($fields)
{
    $patterns = array('!content-type:!i','!multipart/mixed!i','!boundary=!i',
         '!bcc:!i','!cc:!i','!multi-part message in mime format!i',
         '!to:!i','!from:!i',"!\r!","\r\n");
     $replace  = '';
     return is_array( $fields ) ? array_map( 'clean_variables_for_mail', $fields ) 
                               : preg_replace($patterns,$replace,$fields);
}
?>